import request from '@/config/axios'

// 房产抵押贷款信息 VO
export interface HouseMortgageVO {
  id: number // 主键id
  userId: number // 关联用户ID
  propertyAddress: string // 房产地址
  propertyType: string // 房产类型（住宅/商业/别墅/公寓/其他）
  propertyArea: number // 房产面积（平方米）
  assessedValue: number // 房产评估价值（元）
  licenseNumber: string // 房产证编号
  licensePhoto: string // 房产证照片存储路径
  mortgageStatus: string // 抵押状态
}

// 房产抵押贷款信息 API
export const HouseMortgageApi = {
  // 查询房产抵押贷款信息分页
  getHouseMortgagePage: async (params: any) => {
    return await request.get({ url: `/system/house-mortgage/page`, params })
  },

  // 查询房产抵押贷款信息详情
  getHouseMortgage: async (id: number) => {
    return await request.get({ url: `/system/house-mortgage/get?id=` + id })
  },

  // 新增房产抵押贷款信息
  createHouseMortgage: async (data: HouseMortgageVO) => {
    return await request.post({ url: `/system/house-mortgage/create`, data })
  },

  // 修改房产抵押贷款信息
  updateHouseMortgage: async (data: HouseMortgageVO) => {
    return await request.put({ url: `/system/house-mortgage/update`, data })
  },

  // 删除房产抵押贷款信息
  deleteHouseMortgage: async (id: number) => {
    return await request.delete({ url: `/system/house-mortgage/delete?id=` + id })
  },

  // 导出房产抵押贷款信息 Excel
  exportHouseMortgage: async (params) => {
    return await request.download({ url: `/system/house-mortgage/export-excel`, params })
  },
}